//
//  BaseViewController.m
//  MyNewProject
//
//  Created by sun on 2018/12/3.
//  Copyright © 2018 sun. All rights reserved.
//

#import "BaseViewController.h"
#import "NSObject+MemoryUsage.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    self.gk_backStyle = GKNavigationBarBackStyleBlack;//默认都有返回按钮
    
//    self.gk_navBackgroundColor = SKColorWithHex(0x7ab801);
//    self.gk_navTitleColor = [UIColor whiteColor];
    self.gk_navBackgroundColor = [UIColor whiteColor];
    self.gk_navTitleColor = [UIColor blackColor];
    self.gk_navShadowImage = [UIImage new];
    self.gk_navShadowColor = SKClearColor;
    self.gk_navLineHidden = true;
}
- (void)showMessage:(NSString *)msg {
    [self.view makeToast:msg duration:[CSToastManager defaultDuration] position:CSToastPositionCenter style:nil];
}

- (void)debugShowMessage:(NSString *)msg {
#ifdef DEBUG
    if (DEBUG) {
        [self showMessage:msg]; }
#endif
}
-(void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}
- (void)appSizeBlock:(void (^)(NSInteger))block {
    [NSObject getCacheSize:[NSObject cachesPath] complete:block];
}
- (void)removeCashes {
    [NSObject removeCache:[NSObject cachesPath]];
}
- (NSString *)loginKey {
    NSString *key = [UserInfoSingleton shareInstance].userInfo.loginKey;
    if (key.length > 0) {
        return key;
    }else {
        return @"";
    }
}
- (NSString *)uid {
    NSString *uid = [UserInfoSingleton shareInstance].userInfo.uid;
    if (uid.length > 0) {
        return uid;
    }else {
        return @"";
    }
}
@end
